﻿using CaffeeBuzz_WinForm.Cafe;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CaffeeBuzz_WinForm.Factorys
{
    public static class Factory
    {
        private static List<Item> beverages = new List<Item>();

        public static void AddNewBeverage(Item item)
        {
            foreach (var b in beverages)
            {
                if (b.Name == item.Name) // da ton tai
                {
                    return;
                }
            }
            beverages.Add(item);

        }
        public static Item CreateBeverage(string name)
        {
            foreach (var b in beverages)
            {
                if (b.Name == name)
                    return b.Clone();
            }
            return null;
        }
    }
}
